package com.awonsome.common.redis.redisson;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.Objects;

/**
 * @author yangdejun
 * @date 2022/1/26 16:48
 */
@ConfigurationProperties(prefix = "redisson")
@Data
public class RedissonProperties {

    private String serverAddress;

    private String port;

    private String password;

    private Integer database;

    public Integer getDatabase() {
        if (Objects.isNull(database)) {
            return 0;
        }
        return database;
    }

}
